﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.ComponentModel;

namespace ECCIT.Extension.Weibo_v2.Configuration
{
    /// <summary>
    /// Represents the response error handler configuration.
    /// </summary>
    internal class HandlerConfigurationElement : ConfigurationElement
    {
        private const string C_Type = "type";
        private const string C_ErrorCode = "errorCode";

        /// <summary>
        /// Gets or sets the type property.
        /// </summary>
        [ConfigurationProperty(C_Type, IsRequired = true)]
        public string Type
        {
            get
            {
                return (string)this[C_Type];
            }
            set
            {
                this[C_Type] = value;
            }
        }

        /// <summary>
        /// Gets or sets the error code pattern property.
        /// </summary>
        [ConfigurationProperty(C_ErrorCode, IsKey = true)]
        public string ErrorCode
        {
            get
            {
                return (string)this[C_ErrorCode];
            }
            set
            {
                this[C_ErrorCode] = value;
            }
        }
    }
}
